package com.job.client.auth.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(value = "tb_record")
public class Record {
    @Id
    private String id;
    @Field("user_id")
    private String userId;
    @Field("posts_ids")
    private List<String> postsIds;
    @Field("company_ids")
    private List<String> companyIds;
    @Field("connect_posts_ids")
    private List<String> connectPostsIds;

    public Record(String userId, List<String> postsIds, List<String> companyIds, List<String> connectPostsIds) {
        this.userId = userId;
        this.postsIds = postsIds;
        this.companyIds = companyIds;
        this.connectPostsIds = connectPostsIds;
    }

    public Record(String userId) {
        postsIds = new ArrayList<>();
        companyIds = new ArrayList<>();
        connectPostsIds = new ArrayList<>();
        this.userId = userId;
    }
}
